package com.cats.activity;

import android.app.TabActivity;
import android.content.Context;
import android.content.Intent;
import android.content.res.Resources;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.TabHost;
import android.widget.TextView;
import android.widget.TabHost.OnTabChangeListener;
import android.widget.TabHost.TabContentFactory;
import android.widget.TabHost.TabSpec;

import com.cats.R;


public class ShipmentListActivity extends TabActivity implements OnTabChangeListener {
	
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_shipment_list);
		getActionBar().setTitle("Shipment List");

		TabHost tabHost = (TabHost) findViewById(android.R.id.tabhost); 
		
		/**
		 *  Recent Month shipmenets, active
		 */
		Intent intentAndroid = new Intent().setClass(this, ShipmentListSubviewActivityRecent.class);
		TabSpec tabSpecAndroid = tabHost
			.newTabSpec("A")
			.setIndicator("Recent month", null)
			.setContent(intentAndroid);

		/**
		 *  Month Ago shipments, inactive
		 */
		Intent intentApple = new Intent().setClass(this, ShipmentListSubviewActivityHistory.class);
		TabSpec tabSpecApple = tabHost
			.newTabSpec("B")
			.setIndicator("Month Ago", null)
			.setContent(intentApple);
			
		/**
		 *  add all tabs 
		 */
		tabHost.addTab(tabSpecAndroid);
		tabHost.addTab(tabSpecApple);
		
		tabHost.setOnTabChangedListener(this);
		
		/**
		 * set Windows tab as default (zero based)
		 */
		tabHost.setCurrentTab(0);
	}

	@Override
	public void onTabChanged(String tabId) {
		System.out.println("onTabChanged:" + tabId);
		TabHost tabHost = (TabHost) findViewById(android.R.id.tabhost); 
	}

}

